<?php
if (!defined('TOBBIVM')) header('location:/template/notrepassing.php');
/**
 * This file is part of TobbiVMShop.
 *
 * TobbiVMShop is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TobbiVMShop is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TobbiVMShop.  If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Create the topmenu and highlight the aktiv Item
 *
 * @version    $Id$
 * @package    TobbiVM-Shop
 * @copyright  Copyright (C) 2012
 * @author     Norbert Gebert
 * @license    GPL3
 */

/**
 * Mainfunction to get the HTML-String for the Topmenu
 *
 * Used Templatefile: topmenu.tpl.html
 * @param  string   1. Parameter
 * @param  string   2. Parameter...
 * @return boolean  False if failed 
 */
function topmenu( $selectedPage, $refPage, $menu )
{
	// Create Topmenu
	foreach ($menu as $value)
	{
		// Setting class for aktive Menueitem
		if ( $value[0] == $selectedPage )
		{
			$class = 'class="current"';
		} else {
			$class = '';
		}

		$refPage->assign('topmenu_tpl_' . $value[0] . 'Link', '<a ' . $class .
				' href="index2.php?page=' . $value[0] . '">' . _($value[1]) . '</a>');
	}
}
?>